﻿using System.ServiceModel.Activation;
using MyFloridaHouse.libServiceBusinessRules;
using MyFloridaHouse.libSTO;
using MyFloridaHouse.libSvDTO;
using System;
using Microsoft.SqlServer.Types;
using System.Collections.Generic;

namespace MyFloridaHouse.MapServer
{
	[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
	public class DistrBldr : IDistrBldr
	{
        public StructureSTO  GetDataStructures()
        {
            return new StructureSTO();
        }

        public CensusGeometrySTO StartupGetCensusGeometry(DateTime clientFileTimestamp)
        {
            return CensusGeometry.GetCensusGeometry(clientFileTimestamp);
        }

        public DistrictPlanTypeSTO StartupGetDistrictPlanTypes(DateTime clientFileTimestamp)
		{
            return DistrictPlanTypes.GetDistrictPlanTypes(clientFileTimestamp);
		}

        public LayerSTO StartupGetLayers()
        {
            return AppLayers.GetLayers();
        }


        public FileSTO GetCloudFile(FileInfoDTO fileToGet)
        {
            return File.GetCloudFile(fileToGet);
        }

        public FileInfoSTO GetCloudFileInfo(string directoryName)
		{
            return File.GetBlobFileInfo(directoryName);
		}


        
        public ShapeUogidSTO GetShapeUogIDs(string iWktList, int iLayerID, int iDistrictID)
		{
			return ShapeUogIDs.GetShapeUogIDs(iWktList, iLayerID, iDistrictID);
		}

		public DistrictShapeSTO GetDistrictShape(byte[] compressedShapeList, int districtID)
		{
			return DistrictShape.GetDistrictShape(compressedShapeList, districtID);
		}

        public DistrictShapeClippedSTO GetDistrictShapeClipped(DistrictShapeClippedSTO sto)
        {
            return DistrictShape.GetDistrictShapeClipped(sto);
        }

		public DistrictDataSummarySTO GetDistrictDataSummary(int iDistrictID, byte[] compressediRegionIDList, string iSourceLayerIDList, string iDictionaryIDList)
		{
			return DistrictDataSummary.GetDistrictDataSummary(iDistrictID, compressediRegionIDList, iSourceLayerIDList, iDictionaryIDList);
		}

		public ACSDistrictSummaryReportSTO GetACSDistrictDataSummary(int iDistrictID, byte[] compressediRegionIDList, string iSourceLayerID, string iTableIDList)
		{
			return Report.GetACSDistrictDataSummary(iDistrictID, compressediRegionIDList, iSourceLayerID, iTableIDList);
		}

		public ACSDistrictSummaryReportDefinitionSTO GetACSReportDefinition()
		{
			return Report.GetACSReportDefinition();
		}

		public RegionDataListSTO GetRegionDataList(int iLayerID, int iRegionID)
		{
			return RegionData.GetRegionDataList(iLayerID, iRegionID);
		}


        public RegionShapesInViewSTO GetRegionShapesInView(RegionShapesInViewSTO sto)
        {
            return BoundingBoxRegions.GetRegionShapesInView(sto);
        }

        public RegionIDsSTO GetRegionIDsInView(int layerID, double iNorth, double iEast, double iSouth, double iWest)
        {
            return BoundingBoxRegions.GetRegionIDsInView(layerID,  iNorth,  iEast,  iSouth,  iWest);
        }

        public RegionsShapesSTO GetRegionListShapes(double zoomLevel, int iTargetLayerID, List<int> iRegionIDList)
        {
            return BoundingBoxRegions.GetRegionListShapes(zoomLevel, iTargetLayerID, iRegionIDList);
        }

        public LayerRegionsDataSTO GetRegionListData(int iTargetLayerID, List<int> iRegionIDList, string iSourceLayerIDList, string iDictionaryIDList)
        {
            return BoundingBoxRegions.GetRegionListData(iTargetLayerID, iRegionIDList, iSourceLayerIDList, iDictionaryIDList);
        }

		//Todo: Future code.
		#region Future code

        public DataDictionaryDenominatorSTO GetDataDictionaryDenominators(string iDataPartIDList)
        {
            return DataDictionary.GetDataDictionaryDenominators(iDataPartIDList);
        }

        public DataDictionaryPartSTO GetDataDictionaryParts()
        {
            return DataDictionary.GetDataDictionaryParts();
        }

        public DataDictionarySTO GetLayerDataDictionary(int layerID)
        {
            return DataDictionary.GetLayerDataDictionary(layerID);
        }

		#endregion

	}
}
